let bSwiper = function (ev) {
  if ($('.cm6')) {
    // console.log($(comp))
    // console.log($(comp).find('.cm6'))
    let com6 = `<div class="layui-carousel" id="bSwiper">
                  <div carousel-item>
                    <div>
                      <img src='./css/images/swiperdemo2.png' alt=''/>
                    </div>
                    <div>
                      <img src='./css/images/swiperdemo.png' alt=''/>
                    </div>
                    <div>
                      <img src='./css/images/swiperdemo3.png' alt=''/>
                    </div>
                  </div>
                </div>`
    ev.children('.cm6').append(com6)
    layui.use('carousel', function(){
      var carousel = layui.carousel;
      //建造实例
      carousel.render({
        elem: '#bSwiper',
        width: '12rem', //设置容器宽度
        arrow: 'none', //始终显示箭头
        height: '4.5rem'
        //,anim: 'updown' //切换动画方式
      });
    });

    
    // let com6 = `<div id="bSwiper">
    //               <div class="swiper-wrapper">
    //                 <div class="swiper-slide">
    //                   <img src='./css/images/swiperdemo2.png' alt=''/>
    //                 </div>
    //                 <div class="swiper-slide">
    //                   <img src='./css/images/swiperdemo.png' alt=''/>
    //                 </div>
    //                 <div class="swiper-slide">
    //                   <img src='./css/images/swiperdemo3.png' alt=''/>
    //                 </div>
    //               </div>
    //               <div class="swiper-pagination"></div>
    //             </div>`
    // ev.children('.cm6').append(com6)
    // var mySwiper = new Swiper ('#bSwiper', {
    //   loop: true, // 循环模式选项
      
    //   // 如果需要分页器
    //   pagination: {
    //     el: '.swiper-pagination',
    //   }
    // })   
  }
}


